<template>
  <div id="aCoursesList" class="bg-fa of">
    <!-- 讲师列表 开始 -->
    <section class="container">
      <header class="comm-title all-teacher-title">
        <h2 class="fl tac">
          <span class="c-333">全部创始人</span>
        </h2>
        <section class="c-tab-title">
          <a id="subjectAll" title="全部" href="#">全部</a>
        </section>
      </header>
      <section class="c-sort-box unBr">
        <div>
          <!-- /无数据提示 开始-->
          <section class="no-data-wrap" v-if="total == 0">
            <span class="c-666 fsize14 ml10 vam">没有创始人相关的数据，正在努力寻找中...</span>
          </section>
          <!-- /无数据提示 结束-->
          <article class="i-teacher-list" v-if="total > 0">
            <ul class="of">
              <li v-for="founderList in FounderList" :key="founderList.id">
                <section class="i-teach-wrap">
                  <div class="i-teach-pic">
                    <a :href="'/founder/'+founderList.id" :title="founderList.name">
                      <img :src="founderList.picture" :alt="founderList.name">
                    </a>
                  </div>
                  <div class="mt10 hLh30 txtOf tac">
                    <a :href="'/founder/'+founderList.id" :title="founderList.name"
                       class="fsize18 c-666">{{ founderList.name }}</a>
                  </div>
                  <div class="hLh30 txtOf tac">
                    <span class="fsize14 c-999">{{ founderList.intro }}</span>
                  </div>
                  <div class="mt15 i-q-txt">
                    <p class="c-999 f-fA">{{ founderList.intro }}</p>
                  </div>
                </section>
              </li>

            </ul>
            <div class="clear"></div>
          </article>
        </div>
        <!-- 公共分页 开始 -->
        <!--
分页器
当前第几页,数据总页数，每一页展示条数，连续页码数
@current-change="handleCurrentChange"
:current-page代表当前第几页
:total代表分页器需要展示数据的条数
:page-size代表分页器每页需要展示的条数
:page-sizes代表可以设置每页需要展示的条数
layout:可以实现分页器布局
pager-count按钮的数量 如果是6连续页码是4
-->
        <el-pagination v-if="total > 0"
                       style="margin-top: 20px;textAlign:center"
                       :current-page="page"
                       :total="total"
                       :page-size="limit"
                       layout="prev, pager, next,jumper,->,total"
                       @current-change="getFounderPage"
        >
        </el-pagination>
        <!-- 公共分页 结束 -->
      </section>
    </section>
    <!-- /讲师列表 结束 -->
  </div>
</template>
<script>

import founder from "../../api/founder/founder";

export default {

  data() {
    return {

      //创始人数据
      FounderList: [],

      //当前页
      page: 1,
      //当前页个数
      limit: 8,
      //总记录数
      total: 0

    }
  },

  created() {

    //调用创始人分页
    this.getFounderPage();
  },

  methods: {
    //创始人分页
    getFounderPage(page = 1) {
      this.page = page
      founder.getFounderList(this.page, this.limit).then(response => {
        console.log(response)
        this.total = response.data.data.total;
        console.log(this.total);

        this.FounderList = response.data.data.items
        console.log(this.FounderList)
      })


    }

  }


};
</script>
